package test6;

class Test{
    public void test(){
        System.out.println("test()haha");
    }
}

public class Demo6 {
    public static void main(String[] args) {
        new Test(){
            @Override
            public void test() {
                System.out.println("我是重写的test方法");
            }
        }.test();
    }

}
